#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    for (int i = 1; i <= 3 * n; i++) {
        int k = i % 3;
        int m = i / 3;
        for (int j = 1; j <= 6 * n - 1; j++) {
            if (j > 3 * n - i) {
                if (k == 1) {
                    if (j <= 3 * n - i + m + 1) {
                        printf("*     ");
                    }
                }
                else if (k == 2) {
                    if (j <= 3 * n - i + m + 1) {
                        printf("* *   ");
                    }
                }
                else {
                    if (j < 3 * n - i + m + 1) {
                        printf("* * * ");
                    }
                }
            }
            else {
                printf(" ");
            }
        }
        printf("\n");
    }
    for (int i = 0; i < n; i++) {
        for (int j = 1; j <= 3 * n; j++) {
            if (j == 3 * n) {
                printf("*");
            }
            else {
                printf(" ");
            }
        }
        printf("\n");
    }
    return 0;
}